package com.seeyou.lake.util;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;

import java.io.File;

public class GlideUtil {
 
    public static void loadRoundImage(Context context, String imageUrl, int cornerRadius,
                                      ImageView imageView) {
        RequestOptions options = RequestOptions.bitmapTransform(
                new RoundedCorners(cornerRadius));
        Glide.with(context).load(imageUrl).apply(options).into(imageView);
    }

    public static void loadRoundImageFromFile(Context context, String filePath, int cornerRadius,
                                      ImageView imageView) {
        RequestOptions options = RequestOptions.bitmapTransform(
                new RoundedCorners(cornerRadius));
        Glide.with(context).load(new File(filePath)).apply(options).into(imageView);
    }
}